﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using DailyStrips.Utilities;

namespace DailyStrips
{
  public class ImageCache : SizeRestrictedCache<DateTime, ImageSource>
  {
    public ImageCache(int size)
      : base(size)
    {
      expirationCandidate = DateTime.MinValue;
    }

    public override void PostAdd(DateTime key, ImageSource value)
    {
      if (expirationCandidate == DateTime.MinValue) expirationCandidate = key;

      base.PostAdd(key, value);
    }
  }
}
